package br.ucb.sacop.webservice;

import android.util.Log;
import br.ucb.sacop.bean.LoginMobile;

import com.google.gson.Gson;

public class LoginMobileREST extends GenericREST{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private static final String URL = getUrlWs()+"login/";
	
	public String logIn(LoginMobile loginMobile) throws Exception{
		Gson gson = new Gson();
		String loginJSON = gson.toJson(loginMobile);
		String[] resposta = new WebServiceClient().post(URL + "efetuarLogin/", loginJSON);
		if (resposta[0].equals("200")) {
			return resposta[1];
		} else {
			Log.i("sacopTeste", "resposta "+ resposta[0]);
			throw new Exception(resposta[1]);
		}

	}

}
